﻿Public Class SearchResults
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        lbl_SearchPhrase.Text = Request.QueryString("Search")
    End Sub

    Public Function getBaconStars(ByVal stars As Integer)
        'Given the number of stars, this function returns a string with the path to the relative image
        Dim retval As String = ""
        Select Case stars
            Case -1 To -0.99
                retval = "ui/0Bacons.jpg"
            Case 0 To 0.99
                retval = "ui/1Bacons.jpg"
            Case 1 To 1.99
                retval = "ui/2Bacons.jpg"
            Case 2 To 2.99
                retval = "ui/3Bacons.jpg"
            Case 3 To 3.99
                retval = "ui/4Bacons.jpg"
            Case 4 To 4.99
                retval = "ui/5Bacons.jpg"

        End Select
        Return retval
    End Function

    Public Function countItems()
        Dim results As String = ""
        results = lst_Recipes.Items.Count()
        Return results
    End Function

End Class